#!/usr/bin/env python
# encoding: utf-8

import re
class RegexCaller:
  def __init__(self,Expressions = {}):
    self.Expressions = Expressions
  
  def Add(self,ExpressionName,Expression,Options = 0):
    self.Expressions[ExpressionName] = re.compile(Expression,Options)
  
  def Replace(self,String,ExpressionName,With):
    return re.sub(self.Expressions[ExpressionName],With,String)
  
  def FindAll(self,String,ExpressionName):
    return re.findall(self.Expressions[ExpressionName],String)

  